Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 4 - Geometric Operations / Geometric Operations Reference
Functions / Determining Whether Two Areas Touch


GXTouchesShape

You can use the GXTouchesShape function to determine if two shapes touch.

gxBoolean GXTouchesShape(gxShape target, gxShape test);
target
A reference to one shape to test to determine if it touches another.
test
A reference to the other shape to test.
function result
A Boolean value indicating whether the shapes intersect.
DESCRIPTION
The GXTouchesShape function returns true as its function result if the shape specified by the target parameter touches the shape specified by the test parameter--even if they share only an edge or a point--and returns false otherwise.

This function considers the shape fill, the style modifications, and the transform mapping of the target and test shapes. Only areas that are drawn are considered when determining touching.

For example, if the target shape has an even-odd fill and contains an overlapping contour, then the shape has an internal area that is not drawn. If the test shape lies entirely within this area, the GXTouchesShape function returns false.

As another example, if the test shape lies entirely within the target shape, but the target shape has an inverse shape fill, the GXTouchesShape function returns false.

If you provide a target or test shape that is not one of the geometric shape types, this function performs the actions described in the following table:
Shape typeAction taken
bitmapCompares bounding rectangle of bitmap
picturePosts the error illegal_type_for_shape
textConverts to path shape
glyphConverts to path shape
layoutConverts to path shape

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
shape_is_nil 
illegal_type_for_shape(debugging version)
shape_may_not_be_a_picture(debugging version)
SEE ALSO
For examples using this function, see "Determining Whether Two Shapes Touch" beginning on page 4-53.

For a discussion of shape fills, see Chapter 2, "Geometric Shapes," in this book.

For a discussion of style modifications, see Chapter 3, "Geometric Styles," in this book.

For a discussion of transform mappings, see the chapter "Transform Objects" in Inside Macintosh: QuickDraw GX Objects.

To determine if a rectangle touches a shape, use the GXTouchesBoundsShape function, described on page 4-97.

To determine if a shape contains another shape, use the GXContainsShape function, described on page 4-103.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help